import { _decorator, Component, Node } from 'cc';
import { Item } from './Item';
const { ccclass, property } = _decorator;

// 武器类，继承自物品类
@ccclass('Weapon')
export class Weapon extends Item {
    @property
    damage: number = 0;

    @property
    attackSpeed: number = 0;

    itemType: string='武器';

    constructor(name: string, description: string, damage: number, attackSpeed: number, quantity: number, itemType: string) {
        super(name, description, itemType, quantity); // 传递物品类型参数
        this.damage = damage;
        this.attackSpeed = attackSpeed;
    }
}


